'use strict';
import config from '../../user/config/config'
let user={}
export default class extends think.controller.base {
     async __before(action) {
        //登录、注册不验证token
        // if (this.http.url === '/api/login' || this.http.action === '/api/register') {
        //     return;
        // }
        // //获取http-header token
        // let secret=config.secret;
        // let userToken = this.http.header("Authorization");
        // //调用tokenservice中间件
        // let tokenService = think.service("tokenservice");
        // let tokenServiceInstance = new tokenService();
        // //验证token
        // let verifyTokenResult = await tokenServiceInstance.verifyToken(userToken,secret);
        // //服务器错误时
        // if (verifyTokenResult === "fail") {
        //     user = {};
        //     this.fail("token无效")
        // }else{
        //     user = verifyTokenResult;
        // }
        //获取用户信息

        return ;
    }

    userInfo(){
        return user;
    }
}
